<template>
  <custom-table
    :columns="tableColumns"
    :action-url="'/parking/payment/list'"
    has-search
    :search-data="searchData"
  />
</template>

<script>
import CustomTable from '@/components/CustomTable3.vue'
const addins = {
  'Alipay': '支付宝',
  'WeChat': '微信',
  'Cash': '线下'
}

export default {
  components: { CustomTable },
  data() {
    return {
      searchData: [
        { label: '车牌号码', type: 'input', name: 'carNumber' },
        {
          label: '缴纳状态',
          type: 'select',
          name: 'paymentStatus',
          options: [
            { label: '全部', value: ' ' },
            { label: '未缴费', value: '0' },
            { label: '已缴费', value: '1' }
          ]
        }
      ],
      tableColumns: [
        { label: '车牌号码', prop: 'carNumber' },
        { label: '收费类型', prop: 'chargeType', render: ({ row }) => row.type === 'card' ? '月卡' : '临时停车' }, // 收费类型:月卡card,临时停车:temp
        { label: '停车总时长', prop: 'parkingTime' },
        { label: '缴纳费用（元）', prop: 'actualCharge' },
        { label: '缴纳状态', prop: 'paymentStatus', render: ({ row }) => row.paymentStatus ? '已缴纳' : '未缴纳' }, // 缴费状态0未缴纳，1已缴纳
        { label: '缴纳方式', prop: 'paymentMethod', render: ({ row }) => row.paymentMethod ? addins[row.paymentMethod] : '--' }, // 缴费方式支付方式,支付宝:Alipay,微信:WeChat,线下:Cash
        { label: '缴纳时间', prop: 'paymentTime' }
      ]
    }
  }
}
</script>

<style>
</style>
